package com.situ.mall.base.vo;

import com.situ.mall.base.entity.Category;
import com.situ.mall.base.entity.Product;
import com.situ.mall.base.util.C;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * ClassName: IndexProductVO  首页上商品信息VO
 * Package: com.situ.mall.base.vo
 * Description:
 *
 * @Author Darling_达
 * @Create 2023-03-30 10:51
 * @Version 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class IndexProductVO {

    private Integer id;
    private String imgPath;
    private String name;
    private String title;
    private BigDecimal price;

    public IndexProductVO(Product product, Category category) {
        this.id = product.getId();
        this.imgPath = product.getFirstImg();
        this.name = product.getName();
        this.price = product.getPrice();
        this.title = category.getInfo();
    }


}
